﻿<UserControl x:Class="SilveR.Views.StatsViews.SummaryStats"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"

    mc:Ignorable="d"
    d:DesignHeight="420" d:DesignWidth="600">
    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid>
            <Border BorderBrush="Silver" Margin="3,3,3,3" Style="{StaticResource MainAnalysisBorderStyle}" >
                <Grid>
                    <TextBlock Text="Input" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}" />

                    <TextBlock Text="Select dataset" Margin="3,25,0,0"  Style="{StaticResource TextBlockStyle}" />
                    <ComboBox Name="cboData" Margin="95,21,6,6" ItemsSource="{Binding AvailableDataHandlers}" SelectedItem="{Binding SelectedDataHandler, Mode=TwoWay}" DisplayMemberPath="DisplayFileName" SelectionChanged="cboData_SelectionChanged"  Style="{StaticResource ComboBoxStyle}"/>

                    <TextBlock Text="Available variables" Margin="3,48,6,6"  Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Height="174" Margin="3,70,6,6" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}" >
                        <ListBox Name="lstAvailableVariables" DisplayMemberPath="ColumnName" ItemsSource="{Binding AvailableVariables, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Response" Margin="137,48,6,6"  Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget Height="121" AllowDrop="True" Margin="137,70,0,0" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstResponse" DisplayMemberPath="ColumnName" ItemsSource="{Binding Responses, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Transformation" Margin="137,197,0,0"  Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Name="cboTransformations" Margin="137,219,0,0" ItemsSource="{Binding TransformationList}" SelectedItem="{Binding Transformation, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}"/>

                    <TextBlock Text="Categorisation factors" Margin="279,25,6,6"  Style="{StaticResource TextBlockStyle}"/>

                    <TextBlock Text="1st factor" Margin="279,48,6,6"  Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="279,70,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstFirstCatFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding FirstCatFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="2nd factor" Margin="279,95,0,0"  Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="279,117,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstSecondCatFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding SecondCatFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="3rd factor" Margin="279,146,0,0"  Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="279,168,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstThirdCatFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding ThirdCatFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="4th factor" Margin="279,197,0,0"  Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="279,219,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstFourthCatFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding FourthCatFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                </Grid>
            </Border>

            <Border Margin="3,270,6,6" Style="{StaticResource MainAnalysisBorderStyle}">
                <Grid>
                    <TextBlock Text="Summary results" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}"/>

                    <CheckBox Content="Mean" IsChecked="{Binding MeanSelected, Mode=TwoWay}" Margin="3,22,6,6" Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="N" IsChecked="{Binding NSelected, Mode=TwoWay}" Margin="3,45,0,0" Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="Standard deviation" IsChecked="{Binding StDevSelected, Mode=TwoWay}"  Margin="3,68,0,0"  Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="Variances" IsChecked="{Binding VariancesSelected, Mode=TwoWay}"  Margin="3,91,0,0"  Style="{StaticResource CheckBoxStyle}"/>

                    <CheckBox Content="St. err of mean" IsChecked="{Binding StErrSelected, Mode=TwoWay}"  Margin="133,22,0,0" Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="Min and max" IsChecked="{Binding MinAndMaxSelected, Mode=TwoWay}"  Margin="133,45,0,0" Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="Median and quartile" IsChecked="{Binding MedianQuartileSelected, Mode=TwoWay}"  Margin="133,68,0,0" Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="% coefficient of variation" IsChecked="{Binding CoefficientVariationSelected, Mode=TwoWay}" Margin="133,91,0,0" Style="{StaticResource CheckBoxStyle}"/>

                    <CheckBox Content="Confidence intervals" IsChecked="{Binding ConfidenceLimitsSelected, Mode=TwoWay}"  Margin="298,22,0,0" Checked="CheckBox_CheckChanged" Unchecked="CheckBox_CheckChanged" Style="{StaticResource CheckBoxStyle}"/>

                    <TextBlock Text="Sig. level" Margin="298,45,0,0" Style="{StaticResource TextBlockStyle}" />
                    <inputToolkit:NumericUpDown HorizontalAlignment="Left" Margin="379,43,0,0" Name="numConfidenceLimits" IsEnabled="{Binding ConfidenceLimitsSelected, Mode=TwoWay}" VerticalAlignment="Top" Width="57" Value="{Binding ConfidenceLimits, Mode=TwoWay}" />
                    <CheckBox Content="Normal probability plot" IsChecked="{Binding NormalProbabilityPlotSelected, Mode=TwoWay}"  Margin="298,68,0,0" Style="{StaticResource CheckBoxStyle}"/>
                    <CheckBox Content="By categories and overall" IsChecked="{Binding ByCategoriesAndOverall, Mode=TwoWay}"  Margin="298,91,0,0" Style="{StaticResource CheckBoxStyle}"/>
                </Grid>
            </Border>

        </Grid>
    </ScrollViewer>
</UserControl>